package BufferStream;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class BufferedStream2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis =  new FileInputStream("C:\\Users\\啦啦啦\\Desktop\\b.txt");
        BufferedInputStream bis = new BufferedInputStream(fis);
        int len =0;
        /*while((len = bis.read())!=-1)
        {
            System.out.println(len);
        }*/
        byte[] bytes = new byte[1024];
        while((len=bis.read(bytes))!=-1)
        {
            System.out.println(new String(bytes,0,len));
        }
        //还是使用数组来存放数据更高效
        bis.close();
    }
}
